Determine the sum of all real numbers $x$ satisfying
\[(x^2-4x+2)^{x^2-5x+2} = 1.\]
Answer: We consider cases. Either the exponent is $0$, or the base must be either $1$ or $-1$. (These are the only ways that $a^b=1$ is possible if $a$ and $b$ are real numbers.  Also, if the base is $-1$, then the exponent must be an even integer.)

Note: The first two cases use Vieta's Formula for the sum of the roots of a quadratic. A short derivation follows in case you are not familiar with them.

Vieta's Formulas

If $p$ and $q$ are roots of the quadratic $x^2 + bx + c$ then $(x-p)(x-q)=0$. But $(x-p)(x-q) = x^2 - (p+q)x +(pq)$. Therefore, the sum of roots, $p+q$, equals $-b$ and the product of roots, $pq$, equals $c$.

If you have a quadratic where the leading coefficient is not $1$ (and not $0$), then it can be written in the form $ax^2 + bx + c$. Since to find the roots we set it equal to $0$, we can divide the entire thing by $a$ to get $x^2 + \frac ba x + \frac ca = 0$. Similar to the case where the leading coefficient is $1$, the sum of roots, $p+q$ will now be $- \frac ba$ and the product of roots, $pq$, will now be $\frac ca$.

Cases

First case: The exponent is $0$ when $0=x^2-5x+2$. Note that the discriminant of this quadratic equation is $5^2-4(1)(2)=17$, which is positive; thus there are two distinct real roots. By Vieta's formulas, they add up to $5$. Furthermore, note that neither of these roots is also a root of $x^2-4x+2=0$, so we don't have to worry about getting $0^0$ in our original equation. Thus we have our first two solutions, and they add up to $5$.

Second case: The base is $1$ when $0=x^2-4x+1$. Again, this equation has a positive discriminant and thus two real roots. By Vieta's formulas, these roots add up to $4$. Both are automatically solutions to our original equation, since $1^b=1$ for all real $b$.

Third case: The base is $-1$ when $0=x^2-4x+3=(x-1)(x-3)$ (finally, a quadratic we can factor nicely!). This gives us potential solutions of $x=1$ and $x=3$, but we'd better check them! As it turns out $x=1$ gives $(-1)^{-2}=1$ and $x=3$ gives $(-1)^{-4}=1$, so both are solutions to our original equation.

Thus we have six solutions in all. The first two added up to $5$, the next two added up to $4$, and the last two added up to $4$, so the sum of the six solutions is $\boxed{13}$.